package com.uniledger.exchange.home;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.ViewGroup;

import com.uniledger.commonlib.lazy.LazyFragmentPagerAdapter;
import com.uniledger.exchange.dapp.DAppsBrowserFragment;
import com.uniledger.exchange.dapp.DappFragment;
import com.uniledger.exchange.mine.MineFragment;
import com.uniledger.exchange.shopping.ShoppingFragment;

import java.util.ArrayList;
import java.util.List;

public class MainAdapter extends LazyFragmentPagerAdapter {

    private List<Fragment> fragments;

    public MainAdapter(FragmentManager fm) {
        super(fm);
        fragments = new ArrayList<>(3);
        fragments.add(HomeFragment.newInstance("", ""));
        fragments.add(DAppsBrowserFragment.newInstance("", ""));
//        fragments.add(ShoppingFragment.newInstance("", ""));
        fragments.add(MineFragment.newInstance("", ""));
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    protected Fragment getItem(ViewGroup container, int position) {
        return fragments.get(position);
    }
}
